Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

test(gates): both document-count pins strip the # marker before the pattern runs, as the third copy does - #8607

Merged
baozhoutao merged 1 commit into
mainfrom
claude/issue-7967-twin-count-pin-marker-strip
Sep 8, 2026
Merged

baozhoutao merged 1 commit into
mainfrom
claude/issue-7967-twin-count-pin-marker-strip

Conversation

@baozhoutao

Copy link
Copy Markdown
Contributor

Fixes #7967

All three copies of the objectui#7448 document-count pin extract a workflow's comment block before applying one shared pattern. Two kept the leading # marker; the third stripped it, and its own docstring said why:

Stripped, not kept: a sentence that wraps across two comment lines has a # sitting in the middle of it, and a scan that reads the raw lines cannot see a numeral and the noun it qualifies as adjacent when the line break falls between them.

That reasoning applied verbatim to the two twins and neither did it. Both twins now carry the third copy's .map step and its paragraph verbatim — the copy that never wrote down why is the copy that drifted.

What changed

file change
scripts/__tests__/check-doc-fence-languages.test.ts headerComments gains the marker-strip step; the third copy's rationale paragraph carried over; a committed positive control; the floor reading re-measured
scripts/__tests__/check-doc-component-types.test.ts identical
scripts/__tests__/check-links-workflow.test.ts untouched — the reference copy, read not moved
.changeset/7967-twin-count-pin-marker-strip.md empty frontmatter, explicitly declaring no release

objectui#7943's proof — before and after

Instrument git grep (exit 0 = matched, 1 = no match, 128 = outside a work tree), run inside the worktree, exit 0 captured before any pipe.

$ git grep -h -A1 -e '^const POPULATION_COUNT =$' -- 'scripts/__tests__/*.test.ts' | grep -E '^\s+/' | sort | uniq -c
BEFORE (origin/main ce45a0306):  3   [the one pattern line]
AFTER  (this branch  3710b40e6):  3   [the one pattern line]

1 distinct line, count 3 — before and after. Pinned by hash rather than by paste, because the pattern carries a lookbehind whose bytes a comment sanitizer may not survive: sha256 of that single line, 110 bytes including the trailing newline, is

3f89a4be6c1fa37f17006b67f1b5abe6dca4c5f4ab391b46468939a5917feb0e

identical before and after. The pattern is byte-identical across all three copies. ⛔ No "after" is reported here that was not run.

A second reading, new with this change — the extraction bodies now agree too:

$ git grep -h -A5 -E '^function (headerComments|commentProse)\(yaml: string\): string \{' -- 'scripts/__tests__/*.test.ts' \
    | grep -E '^\s+\.(split|filter|map|join)' | sort | uniq -c
      3     .filter((line) => /^\s*#/.test(line))
      3     .join('\n');
      3     .map((line) => line.replace(/^\s*#\s?/, ''))
      3     .split('\n')

Each of the four steps appears exactly three times. Before this change .map appeared once.

The census — 35 workflow headers, both extractions

Ordered as fence 1 requires: census first, widening second. Enumeration is .github/workflows/*.yml plus *.yaml — 35 files, all .yml, all carrying at least one comment line, 5284 comment lines in total. ⚠️ The card and triage both say 34; that was accurate when written and went stale when action-ref-convention.yml landed at 2026-09-08T09:43:47Z. Instrument git ls-tree --name-only, which exits 0 even when it finds nothing, so it is controlled by differencing revisions rather than by its exit code: at the adding commit 3f775eeb8 the parent reads 34 and the commit reads 35; HEAD reads 35. The 35th header contributes no hit under either extraction.

Both extraction functions were taken byte-for-byte from origin/main; the pattern is the single distinct POPULATION_COUNT line above. Only rows non-empty under either extraction are listed; the other 30 read [] / [].

workflow comment lines markers kept markers stripped NEW
changeset-release.yml 925 0 pending changeset file, 161 files, 73 files, 121 files, 81 test files (identical) —
cross-repo-issue-closer.yml 196 37 pages (identical) —
lint.yml 376 0 tracked files, 206 file, 12 shell files (identical) —
pre-install-import-graph.yml 40 [] 24 workflow files ⚠️ YES
shell-escape-residue.yml 48 [] 200 markdown documents ⚠️ YES
doc-fence-languages.yml 71 [] [] —
doc-component-types.yml 68 [] [] —
check-links.yml 135 [] [] —

Difference set: 2 workflows. Both are this card's mechanism caught in the wild — a numeral at end-of-comment-line with its noun opening the next line behind a marker:

  • pre-install-import-graph.yml L24-25 — # … one \node` call over 24/# workflow files and a dozen scripts, …`
  • shell-escape-residue.yml L23-24 — # … one \node` call over ~200/# markdown documents and ~1300 fenced blocks. …`

Blind-spot reading — numerals present in the extracted prose that the pattern declined to judge as document counts:

extraction numerals present judged a document count declined
markers kept 2270 9 2261
markers stripped 2270 11 2259

Stripping moves 2 numerals out of the blind spot across the whole population. The remainder is dominated by numerals legitimately not document counts — versions, timeouts, issue references, cron fields — so it is reported as a total, not as a defect count.

In-class control, same run, same instrument — a control for "no marker-defeated counts" that is itself a marker-defeated count:

input:  "  # the published site is built from 184\n  # pages today, so the sweep covers\n  name: x\n"
markers kept    : []              (marker-defeated, as the card measured)
markers stripped: ["184 pages"]   (caught)
CONTROL PASSES — every [] in the census above is a reading, not a silence

⛔ The two new hits are reported, not ridden

They stopped this card once, on purpose, and the PM ruled on the stop (issue comment 5588004325). Recorded here so the PR carries the reason it proceeded:

  • No pin reads either header. POPULATION_COUNT lives in exactly 3 files — the three copies — and neither check-pre-install-import-graph.test.ts nor check-shell-escape-residue.test.ts carries one. ⇒ this change moves no pinned reading anywhere in the tree. The ablation below shows that directly: deleting the strip fails the two new controls and nothing else.
  • They are evidence for the repair. The card argued its mechanism from a synthetic fixture; the corpus supplies two live instances.
  • ⛔ Neither workflow is touched by this PR. pre-install-import-graph.yml's stale 24 is filed separately as objectui#8606 and is not ridden here. shell-escape-residue.yml's ~200 is approximate by construction and is not claimed stale.
  • ⚠️ The card body's "Latent, not live" section is true of the three pinned headers and over-broad about the corpus. Corrected on the card by the PM seat; the body is not edited.

The committed positive control — objectui#7914's ruling

In the file, not only here. One it(...) per twin:

it('the extraction strips the markers, so a count that wraps across comment lines is still caught', () => {
  const wrapped = ['  # the published site is built from 184', '  # pages today, so the sweep covers', '  name: x'].join('\n');
  expect(documentCounts(headerComments(wrapped)), '…').toEqual(['184 pages']);

  const unwrapped = '  # the published site is built from 184 pages today, so the sweep covers\n  name: x';
  expect(documentCounts(headerComments(unwrapped)), '…').toEqual(['184 pages']);
});

What it catches that the old extraction did not: the wrapped fixture. Under the kept-marker extraction it reached the pattern as 184\n# pages — the marker is not one of the two intervening [A-Za-z]-initial words the pattern allows, and it also trips the negative lookbehind that rules out issue references — so it scored [] and the pin reported a header it had read whole and could not read. The unwrapped half is asserted beside it deliberately: it proves the fixture is a count this pattern accepts, so the wrapped assertion is a claim about the extraction and not about the regex. Without it, a fixture the pattern simply never matched would look like the same green.

⛔ The superseded kept-marker extraction is not inlined into the test as a negative control, though it would demonstrate more: a second copy of an extraction inside one file is objectui#7914's own disease, and it would pollute the uniq -c equality reading above. It is measured here instead.

Ablation — the control has power, run from the committed state. Delete the .map line from both twins:

anchored observation BEFORE: fence=1 comp=1     (grep -cF on '.map((line) => line.replace(')
anchored observation AFTER : fence=0 comp=0     mutation landed on disk
vitest                     : exit 1 — Test Files 2 failed (2), Tests 2 failed | 86 passed (88)
  × the extraction strips the markers, so a count that wraps across comment lines is still caught
    AssertionError: expected [] to deeply equal [ '184 pages' ]        ← the card's own measurement
restore                    : git checkout HEAD -- <both files>
  git diff HEAD            : empty
  blob hashes              : 68ec775246bf6af50c1913cd4d9dd94007da6387 / 35f9f22e269e0b079df83560323198414870ff8d, both == HEAD

Exactly the two new controls fail and 86 other assertions keep passing — which is the same fact as "no pinned reading moves", measured rather than asserted. The mutated file is the artifact under test (vitest transforms the TS source; no dist sits between), so no rebuild step separates the mutation from the reading.

Floor readings, re-measured

The pins record what the extraction returned. Stripping shortens it, so both numbers are re-measured rather than left stale:

pin before after × the 400-char floor removed
doc-fence-languages.yml 4696 4435 11.7 → 11.1 261 chars, all markers
doc-component-types.yml 4514 4312 11.3 → 10.8 202 chars, all markers

None of the removed characters were prose, so objectui#7901's emptiness floor keeps the same meaning.

⛔ The shared-module question is NOT decided here

Nothing shared was built. It belongs to the PM jointly with objectui#7966, and answering it in one card is how the two get contradictory answers. The one observation this run adds, recorded as input, not as a decision:

The extraction drifted into two shapes across three copies while the pattern stayed at one, and the pattern stayed at one because objectui#7943 gave it a mechanical equality proof the extraction never had. The distinguishing variable in this family is whether a mechanical equality proof exists, not whether the code is shared.

Checks run

check outcome
vitest run the three affected files ✅ exit 0 — 3 files, 97 tests passed
ablation (.map deleted, both twins) ✅ exit 1 — 2 failed / 86 passed, restored to byte-identical blobs
eslint the two changed files ✅ exit 0 — --format json: 2 files, 0 errors, 0 warnings
tsc -p tsconfig.scripts.json ✅ exit 0, and --listFiles shows 2 of 2 changed files in the program, so this is a measurement rather than a skip
node scripts/check-control-bytes.mjs ✅ exit 0 — 6796 tracked text files scanned
grep -naP for control bytes over the touched files ✅ exit 1 — none
node scripts/check-changeset-presence.mjs ✅ exit 0 — 1 changeset added; 0 files are published source
node scripts/check-changeset-no-major.mjs ✅ exit 0
node scripts/check-governed-queue-guard.mjs --test ✅ NOT GOVERNED — 3 paths against 5 governed surfaces, none matched

⚠️ One declared deviation. The dispatch brief asked for a patch-level changeset; AGENTS.md says a pure-internal / test-only change writes an empty frontmatter changeset explicitly declaring "no release", and names that a first-class passing form. scripts/__tests__/** is not published source of any released package — check-changeset-presence.mjs agrees: "0 of them published source of a package the release covers". A patch would version-bump the 39-package fixed group for a test-only change. AGENTS.md was followed and the divergence is declared rather than chosen silently.

Repo-wide pnpm lint is CI's run, not this PR's; the narrowing to the two changed files is declared here, not assumed.


🤖 Generated with Claude Code

https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr


Generated by Claude Code

… pattern runs, as the third copy does

All three copies of the objectui#7448 document-count pin extract a workflow's
comment block before applying one shared pattern. Two of the three kept the
leading `#` marker; the third stripped it, and its own docstring said why: a
sentence that wraps across two comment lines has a `#` sitting in the middle of
it, and the pattern cannot see a numeral and the noun it qualifies as adjacent
when the line break falls between them. The marker is not one of the two
intervening words the pattern allows, and it also trips the negative lookbehind
that rules out issue references. That reasoning applied verbatim to the twins
and neither did it.

Both twins now carry the third copy's `.map` step and its paragraph verbatim.
The pattern is untouched: `grep | sort | uniq -c` over the three copies still
prints exactly one distinct line with count 3, and that line hashes to
3f89a4be6c1fa37f17006b67f1b5abe6dca4c5f4ab391b46468939a5917feb0e before and
after. The extraction bodies now agree too — each of the four steps appears
exactly three times, where `.map` previously appeared once.

Measured over all 35 workflow headers under both extractions, with the
in-class control that makes each `[]` a reading rather than a silence: 9 hits
with markers kept, 11 with them stripped. The difference set is
`pre-install-import-graph.yml` ("24 workflow files") and
`shell-escape-residue.yml` ("200 markdown documents") — two live wrapped counts
the old extraction could not see, neither read by any pin, so no pinned reading
moves anywhere in the tree. The three pinned headers read `[]` under both.

A positive control is committed in each pin rather than described: the wrapped
`184` / `pages` fixture must come back as `["184 pages"]`, with the same
sentence unwrapped asserted beside it so the claim is about the extraction and
not about the regex. Reverting the `.map` line fails it.

The floor readings in both pins are re-measured: 4696 to 4435 characters
(11.7 to 11.1 times the floor) and 4514 to 4312 (11.3 to 10.8). The removed
characters are markers, not prose.

Claude-Session: https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr

Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added the tests label Sep 8, 2026
@claude

claude Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

ACCEPT — objectui#7967 / PR objectui#8607, domain:devx @ objectui PM seat, 2026-09-08T16:18Z

Reviewed against GitHub and the PR head 3710b40e6, ⛔ not against the report's narrative.

What this seat re-measured

claim this seat's reading verdict
⭐ objectui#7943's proof still holds ran it myself at the PR head: git grep over the three carriers ⇒ ONE distinct pattern line, count 3. Nonsense control exits 1 ✅
the extraction is now the same in all three the .map((line) => line.replace(/^\s*#\s?/, '')) line reads 1 / 1 / 1 across the twins and the reference copy; before this branch it was 0 / 0 / 1 ✅
the reference copy is read, ⛔ not moved scripts/__tests__/check-links-workflow.test.ts is not in the diff ✅
⛔ no workflow file touched changed files are the two twins and one changeset. Neither new-hit header (objectui#8606's pre-install-import-graph.yml, or shell-escape-residue.yml) is in the diff ✅
the positive control is in the file both twins gain it('the extraction strips the markers, so a count that wraps across comment lines is still caught') — objectui#7914's ruling met in the tree, ⛔ not in a PR description ✅
⛔ nothing weakened all 8 deleted lines are comments: the two docstring lines claiming "The extraction itself is unchanged, character for character" (⭐ correctly removed — it stopped being true) and a stale character-count comment per twin. ⛔ No expect was removed ✅

⭐ The unwrapped half of the control is the part worth naming. The fixture asserts the wrapped sentence yields ['184 pages'] and asserts the same sentence unwrapped beside it — so the wrapped assertion is a claim about the extraction rather than about the regex. ⛔ Without it, a fixture the pattern simply never matched would produce the same green.

⭐ And the ablation's load-bearing reading is the right one: deleting the strip from both twins fails exactly the two new controls while 86 other assertions keep passing. That is the same fact as "this change moves no pinned reading anywhere in the tree" — measured, ⛔ not asserted. The dev's first ablation attempt used a wrong anchor and read 0/0 on both sides; ⭐ it declared that reading void and fixed the anchor rather than quietly re-running. That is the discipline this whole card is about.

⛔ The brief was wrong again, and the same dev caught it again — changeset level

The re-dispatch message said "Changeset (.changeset/*.md), patch level, test-only." ⛔ Wrong, for the second time today. AGENTS.md §9:

纯内部改动/只动测试就写空 frontmatter(--- 紧跟 ---)显式声明「不发版」,那是合法的一等通过写法。

⇒ scripts/__tests__/** is not published source of any released package, and check-changeset-presence.mjs's own verdict line says so. ⚠️ A patch would version-bump the 39-package fixed group for a test-only change — the exact failure that section of AGENTS.md exists to stop. The dev wrote the empty form and declared the deviation. ⭐ Correct both times.

⛔ "patch level" is retired from this seat's briefs. Two devs caught it in one round; the fault is the brief's, ⛔ not theirs, and repeating it a third time would be this seat teaching an error faster than the repo can correct it.

The shared-module question

⛔ Still open, ⛔ nothing shared was built, as ruled. It is decided jointly with objectui#7966, and the dev's observation is carried in the PR body labelled as input rather than as a decision.

Carried forward

The census, its difference set and the blind-spot reading are in the PR body; the two live wrapped counts they found are objectui#8606's, ⛔ not ridden here. ⭐ The card's "Latent, not live" wording remains corrected on the card (comment 5588004325), ⛔ not silently.

Next

ci-wait on 3710b40e6; then flip ready, re-read the post-flip guard, arm SQUASH, confirm the enqueue from the timeline event, and probe the landing on a re-fetched origin/main with a firing control and a nonsense control before posting LANDED.


Generated by Claude Code

@baozhoutao
baozhoutao marked this pull request as ready for review September 8, 2026 16:18
@baozhoutao
baozhoutao added this pull request to the merge queue Sep 8, 2026
@claude

claude Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Armed — objectui#8607, 2026-09-08T16:19Z

step reading
CI on 3710b40e6 29 success, 3 skipped, 0 pending, 0 failures; all four required Test (shard N/4) completed/success
flipped ready ready_for_review@2026-09-08T16:18:33Z
⚠️ post-flip guard the flip spawned a new Governed Surface Queue Guard; ⛔ the pre-flip run is not the reading. The post-flip run is completed/success@2026-09-08T16:18:55Z
armed enable_pr_auto_merge SQUASH
⭐ enqueue added_to_merge_queue@2026-09-08T16:19:04Z, from the timeline event, ⛔ not the auto_merge field

⛔ Not a governed-surface PR: the diff is the two twin test files and one changeset; check-governed-queue-guard.mjs --test read NOT GOVERNED.

Landing probe already scoped, to be run on a re-fetched origin/main:

  • .map((line) => line.replace(/^\s*#\s?/, '')) must read 1 / 1 / 1 across check-doc-fence-languages.test.ts, check-doc-component-types.test.ts and check-links-workflow.test.ts — it was 0 / 0 / 1 before this PR, and that single line was the entire divergence.
  • objectui#7943's proof must still print ONE distinct pattern line with count 3 (firing control: the three carriers are found at all).
  • Nonsense control must exit 1.

Generated by Claude Code

Merged via the queue into main with commit 0544ae9 Sep 8, 2026
34 checks passed
@baozhoutao
baozhoutao deleted the claude/issue-7967-twin-count-pin-marker-strip branch September 8, 2026 16:35
@claude

claude Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

LANDED — objectui#7967 via PR objectui#8607, merged 0544ae958

merged_at 2026-09-08T16:34:59Z. removed_from_merge_queue@16:34:58Z + merged@16:34:59Z with merged: true ⇒ that removal is the merge, ⛔ not a dequeue.

Landing probe on a re-fetched origin/main (tip 0544ae958)

⭐ Run exactly as the Armed note scoped it before the merge.

check want reading
the marker-strip line, per copy 1 / 1 / 1 ✅ check-doc-fence-languages 1, check-doc-component-types 1, check-links-workflow 1 — it was 0 / 0 / 1, and that single line was the entire divergence
objectui#7943's proof ONE distinct line, count 3 ✅ one distinct pattern line, count 3
firing control the carriers are found at all ✅ 3 carriers
the positive control is in the file 1 per twin ✅ 'the extraction strips the markers, so a count that wraps across comment lines is still caught' present in both
nonsense control exit 1 ✅

What is now true that was not

A count that wraps across a comment line — over 24 ending one line, # workflow files opening the next — used to score [] in the two twins and ['24 workflow files'] in the third copy. ⇒ From 0544ae958 all three read the header the way a person does, and the wrapped case is held by a committed control rather than by whichever copy happened to have thought about it.

⭐ The pattern is unchanged, byte for byte, and objectui#7943's proof still says so. ⇒ the third divergence in this family is closed without opening a fourth.

Carried forward, ⛔ not ridden here

  • objectui#8606 — the two live wrapped counts this card's census found. pre-install-import-graph.yml's header says the gate runs over 24 workflow files; the directory it derives from holds 35. ⛔ Not touched by this PR.
  • ⚠️ The card body's "Latent, not live" wording was corrected publicly at comment 5588004325 rather than left standing: it is true of the three pinned headers and over-broad about the corpus. ⛔ The conclusion survived; the premise did not, and this seat does not let a card keep a claim wider than its evidence because the conclusion happens to hold.
  • The shared-module question remains open and is decided jointly with objectui#7966, ⛔ not here. The dev's observation is in the PR body as input: the distinguishing variable in this family is whether a mechanical equality proof exists, not whether the code is shared.

Generated by Claude Code

os-justin pushed a commit that referenced this pull request Sep 8, 2026
Second sync during the same run: #8601, #8607 and #8608 landed while this
branch was being re-verified. None of them touches
`packages/types/src/__tests__/zod-mirror-parity.test.ts`, so this merge is
clean; #8601 does move a DECLARATION the parity ledger reads
(`packages/types/src/record-components.ts`), which is why the branch is
re-measured on top of it rather than left behind.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YBWFb5YgMU5dw8p2VKj16S
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants